x86/AMD: adjust SYSCFG, TOM, etc exposure to deal with running nested
authorJan Beulich <jbeulich@suse.com>
Mon, 19 Jul 2021 10:28:50 +0000 (12:28 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 19 Jul 2021 10:28:50 +0000 (12:28 +0200)
commit471383ddd1843700fdd7d74242ba0e5f314dc678
tree11c06a76c5ef7235cb12035ab108ae6f1048781d
parent0be5a00af590c97ea553aadb60f1e0b3af53d8f6
x86/AMD: adjust SYSCFG, TOM, etc exposure to deal with running nested

In the original change I neglected to consider the case of us running as
L1 under another Xen. In this case we're not Dom0, so the underlying Xen
wouldn't permit us access to these MSRs. As an immediate workaround use
rdmsr_safe(); I don't view this as the final solution though, as the
original problem the earlier change tried to address also applies when
running nested. Yet it is then unclear to me how to properly address the
issue: We shouldn't generally expose the MSR values, but handing back
zero (or effectively any other static value) doesn't look appropriate
either.

Fixes: bfcdaae9c210 ("x86/AMD: expose SYSCFG, TOM, TOM2, and IORRs to Dom0")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/x86/msr.c